package cool.houge.ws.impl;

import com.dslplatform.json.DslJson;
import cool.houge.ws.AuthHandler;
import cool.houge.ws.packet.Packet;
import cool.houge.ws.session.DefaultSession;
import cool.houge.ws.session.Session;
import jakarta.inject.Singleton;
import reactor.core.publisher.Mono;
import reactor.netty.http.websocket.WebsocketInbound;
import reactor.netty.http.websocket.WebsocketOutbound;

/**
 * @author ZY (kzou227@qq.com)
 */
@Singleton
public class NothingAuthHandler implements AuthHandler {

  @Override
  public Mono<Session> handle(
      WebsocketInbound inbound, WebsocketOutbound outbound, DslJson<Packet> json) {
    var session = new DefaultSession(inbound, outbound, json, 0, null);
    return Mono.just(session);
  }
}
